package com.firexxx.study.designmodel.singleton;

/**
 * @description: TODO
 * @throws:
 * @author: zhuangzhang2
 * @date: 2019/11/12 09:16
 */
public class LazySingleton {

    private static volatile LazySingleton instance = null;

    private LazySingleton() {

    }

    public static LazySingleton getInstance() {
        if (instance == null) {
            synchronized(LazySingleton.class) {
                return new LazySingleton();
            }
        }

        return instance;
    }
}